﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Collections.ObjectModel;

namespace Infrastructure.Converters
{
    public class WCNOLinesConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null) return null;
            ObservableCollection<string> val = new ObservableCollection<string>();
            ObservableCollection<string> li = value as ObservableCollection<string>;
            foreach (var item in li)
            {
                if (WCNOMapping.WCNOS.ContainsKey(item))
                    val.Add(WCNOMapping.WCNOS[item]);
                else val.Add(item);
            }
            return val;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
